DansMazes v1.13, written by Daniel Pink in BlitzBasic ][ This prog is MailWare. No money expected. Yes, its FREE! Requirements ============ Needs an Amiga, running OS 2.04 or above, the Reqtools.library and the Gadtools.library in you Libs: directory. See discussion on memory usage for memory requirements. Description =========== Dans mazes allows mazes to be created up to a size of 1000x1000, memory permitting. The mazes created have only one route through, and all parts of the maze should be accessible. It also allows mazes to be saved and loaded, and viewed in a 2D and a 3D format. These five options can be accessed via the buttons in the main window, each of which has a hot key. Buttons ======= Create New Maze Button This is the function that DansMazes is based around. Just enter values for the width and height, and a maze will be generated to those requirements. As larger mazes take longer to produce, there is an option of a progress indicator. See Config section later for details. Save Current Maze Button This allows a maze to be saved to disk. First a file requester prompts for a file name, and then there is an option to save in a packed or unpacked format. The unpacked format takes ((NoColumns+2)*(NoRows+1))+8 bytes for the maze, while the packed format takes ((NoColumns+2)*(NoRows+1)/4)+8 bytes. I.E. A 100 by 100 maze will use 10310 bytes in the unpacked format, and 2583 bytes in the packed format. The packing and unpacking process is so fast on my A1200 @28 Mhz that the time taken to pack and unpack is hardly noticeable! Load New Maze Button This allows a previously saved maze to be reloaded. A file requester prompts for a file name, and then the maze is loaded. Packed and unpacked formats are automatically recognised. View Maze (2D) Button This allows a maze to be viewed in 2D. First the maze is drawn to a bitmap, and then a window opens to allow the bitmap to be viewed. The maze is drawn using the number of pixels per square specified in the config. As large mazes take a while to draw there is an option of a progress indicator. See Config section for details. View Maze (3D) Button This opens a window and shows a 3D view of the maze, facing south from the start position. The maze can then be explored using a joystick in the joystick port, or the cursor keys. The direction faced can be altered by pushing left or right, and backwards and forwards allows a single step, if the way is not blocked! The view can be altered via the menu for the 3D window. Menus ===== Main Menu The About option brings up an about requester, which also gives details about the size and memory usage of the current maze. The Save Config option saves the current config information to the programs icon file. The Indicator Rate option allows the rate at which the indicator is updated to be altered. The figure specifies the amount of time between updates in ticks. (1/50th second for PAL, 1/60th second for NTSC) The 2D Pixel option allows the amount of pixels used by the 2D drawing routine to be altered. The Quit option. Well, who would want to anyway :) 2D Maze Menu The Save Bitmap option allows the 2D bitmap to be saved to disk in IFF format. The Close Window option closes the 2D Maze window. 3D Maze Menu The Close Window option closes the 3D Maze window. The Inside View option alters the 3D view to inside the maze. The Above View option alters the 3D view to slightly above the maze. Keyboard Shortcuts. =================== All of the menus have keyboard shortcuts, all requesters can be operated via the keyboard, the buttons in the main window can be accessed via the keyboard, movement about the 3D maze uses the keyboard, the 2D maze can be scrolled with the cursor keys, and the active window can be altered with the TAB key. Config ====== Configuration information is stored in the icon file. This can also be written to using the option in the main window. If no information is present or it is invalid then default values are used. Config items are as follows :- MAINWIDTH=xxx specifies the width of the main window in pixels. MAINHEIGHT=xxx specifies the height of the main window in pixels. MAINX=xxx specifies the X position of the top left of the main window in pixels. MAINY=xxx specifies the Y position of the top left of the main window in pixels. 3DVIEW=ABOVE|INSIDE specifies which view to use by default for the 3D window. Only use ONE of the values! 2DPIXACROSS=xx specifies the number of pixels to use across for each square. 2DPIXDOWN=xx specifies the number of pixels to use down for each square. INDICATORRATE=xx specifies the rate to update the progress indicator. (10..60 ticks) MAZELARGE=xxx specifies the size in area of the maze at which to use a progress indicator. This allows the progress indicator to be used when the maze will take a long time to be processed, which will obviously be different for different machine specs. Memory usage ============ For large mazes the memory usage can be quite intensive. If you try to create a maze which is too large, or draw a maze which is too large, then the program won't guru, but should exit cleanly, returning ALL memory that was in use. The current memory usage can be viewed in the About requester. A 1000x1000 maze would use 1000*1000 bytes (976.6 K) of fast ram if available, or chip ram otherwise. A 1000x1000 maze with 4 pixels across and down per square would need 1953K of CHIP ram for the 2D bitmap. The 3D bitmap used is not dependent on the maze size, but the size of your screen. Mazes can be created to a larger size than 1000x1000, this was just a figure I decided upon that seems much larger than is needed, unless you're really sad I doubt you could really be bothered to complete a maze that big! The only reason for creating a maze that big is to show that it can be done. If you're having problems getting it to work, want to express an opinion on the prog, have any suggestions for improvements, you want a copy of the BB2 source code or you're just a bit bored, then email me. Also if you want to use it to generate mazes for a game, let me know and I'll explain the file format. Also, if you could let me know the config of your machine, as this program has only been tested on my 3.0 Dos A1200, and I would like to know if it works on different dos versions. In theory it should work on 2.0, but I haven't been able check this yet. .------------------------. | --. | | | \ ,--, ,--, | | | | | | | | | | ---' `--`-` ' | |========================| | D.C.J.Pink@Herts.ac.uk | | (until ~July 1995) | `------------------------' Thanks to Acid software for the excellent BlitzBasic ][. (If you haven't got it, then BUY it NOW, its worth every penny/cent/etc!) LES (Leading Edge Software) for their update to the BlitzBasic Debugger, and many new Blitz commands. Neil O'Rourke for his Blitz commands for the progress indicator, and for access to the ReqTools lib. History ======= V1.14 Bug fix. Visited Mr Guru if a maze not requiring the progress indicator was created after one that did require the progress indicator. V1.13 First release on aminet